package com.rongshu.view.userInfo.fragment;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.rongshu.R;
import com.rongshu.utils.Constant;
import com.rongshu.utils.GlideUtils;
import com.rongshu.view.base.BaseFragment;
import com.rongshu.view.userInfo.adapter.IntimarcySortAdapter;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.widget.CircleImageView;

import butterknife.BindView;

public class TotalSortFragment extends BaseFragment {
    @BindView(R.id.refreshLayout)
    SmartRefreshLayout refreshLayout;
    @BindView(R.id.recyclerView)
    RecyclerView recyclerView;
    @BindView(R.id.iv_silver)
    CircleImageView iv_silver;
    @BindView(R.id.iv_gold)
    CircleImageView iv_gold;
    @BindView(R.id.iv_copper)
    CircleImageView iv_copper;
    //区分总排行，今日排行
    private int type = 0;
    //manager
    private LinearLayoutManager manager;
    //adapter
    private IntimarcySortAdapter adapter;

    @Override
    protected int attachLayoutRes() {
        return R.layout.fragment_total_sort_view;
    }

    @Override
    protected void initViews() {
        type = getArguments() != null ? getArguments().getInt(Constant.INTENT_TYPE) : type;
    }

    @Override
    protected void initData() {
        GlideUtils.loadImageView(getActivity(), iv_silver, "http://img.52rongshu.com:10014/UploadImgFiles/20190322/a8cf62f3-da67-4bea-8f65-a7afa284e453.jpg", R.drawable.user_head_icon, R.drawable.user_head_icon);
        GlideUtils.loadImageView(getActivity(), iv_gold, "http://img.52rongshu.com:10014/UploadImgFiles/20190318/914cc6e2-a888-40be-9a8b-a85094815c26.jpg", R.drawable.user_head_icon, R.drawable.user_head_icon);
        GlideUtils.loadImageView(getActivity(), iv_copper, "http://img.52rongshu.com:10014/UploadImgFiles/20190124/09ea7167-7cea-4519-9a79-33676a3f9b37.jpg", R.drawable.user_head_icon, R.drawable.user_head_icon);
        //manager
        manager = new LinearLayoutManager(getActivity());
        //adapter
        adapter = new IntimarcySortAdapter();
        //refreshLayout
        refreshLayout.setEnableRefresh(false);
        refreshLayout.setEnableHeaderTranslationContent(false);
        refreshLayout.setEnableAutoLoadmore(false);
        //recyclerview
        recyclerView.setLayoutManager(manager);
        recyclerView.setAdapter(adapter);
    }

    @Override
    protected void updateViews(boolean isRefresh) {

    }
}
